<%@ page import="java.util.Date" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>fmt</title>
</head>
<body>
<%
    Date date = new Date();
    pageContext.setAttribute("d", date);
%>
<fmt:formatDate value="${d }" pattern="yyyy-MM-dd HH:mm:ss"/>
<br/>
<%
    double d1 = 3.5;
    double d2 = 4.4;
    pageContext.setAttribute("d1", d1);
    pageContext.setAttribute("d2", d2);
%>
<fmt:formatNumber value="${d1 }" pattern="0.00"/>
<br/>
<fmt:formatNumber value="${d2 }" pattern="#.##"/>
</body>
</html>
